package com.cg.entity;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.enums.SqlMethod;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cg.mapper.OrderMapper;
import lombok.Setter;
import org.apache.ibatis.binding.MapperMethod;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;

import java.util.Collection;
import java.util.Objects;

@Setter
@Service
public class OrderService extends ServiceImpl<OrderMapper,Order> {

    private LambdaQueryWrapper<Order> productionPlanTaskLogPOLambdaQueryWrapper;

//    @Override
//    public boolean updateBatchById(Collection<Order> entityList) {
//        String sqlStatement = super.sqlStatement(SqlMethod.UPDATE);
//        return this.executeBatch(entityList, 1000, (sqlSession, entity) -> {
//            productionPlanTaskLogPOLambdaQueryWrapper.in(Order::getOrderId,entity.getOrderId());
//            MapperMethod.ParamMap<Object> param = new MapperMethod.ParamMap();
//            param.put("et", entity);
//            param.put(Constants.WRAPPER,productionPlanTaskLogPOLambdaQueryWrapper);
//            sqlSession.update(sqlStatement, param);
//        });
//    }

}
